<?php
/**
 * Created by 链行天下.
 * User: tangjianing(990921093@qq.com)
 * Date: 2019/1/31 15:18
 */

namespace Framework;

/**
 * 配置类
 * @package Framework
 */
class Config
{
    public static $_config = [];
    /**
     * 初始加载配置
     * @author: tangjianing(990921093@qq.com)
     * @date: 2019/1/31 15:19
     */
    public static function load()
    {
        self::$_config = require_once 'SystemConfig.php';
    }

    /**
     * 获取所有配置
     * @author: tangjianing(990921093@qq.com)
     * @date: 2019/1/31 15:44
     * @return array
     */
    public static function all()
    {
        return self::$_config;
    }

    /**
     * 获取配置
     * @author: tangjianing(990921093@qq.com)
     * @date: 2019/1/31 15:25
     * @param $key
     * @return mixed|null
     */
    public static function getConfig($key){
        return self::$_config[$key] ?? null;
    }

    /**
     * 设置配置
     * @author: tangjianing(990921093@qq.com)
     * @date: 2019/1/31 15:25
     * @param $key
     * @param $value
     * @return mixed
     */
    public static function setConfig($key, $value)
    {
        return self::$_config[$key] = $value;
    }
}